<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <div id="app">
    <h2>{{ person.name }} -- {{ person.age }}</h2>
    <h3>{{ person.fav }}</h3>
    <ul>
      <li>1</li>
      <li>2</li>
      <li>3</li>
    </ul>
    <h3>{{ msg }}</h3>
    <div v-text="msg"></div>
    <div v-text="person.fav"></div>
    <div v-html="htmlStr"></div>
    <input type="text" v-model="msg">
    <button v-on:click="handleClick">btn one</button>
    <button @click="handleClick">btn two</button>
  </div>
  <script src="./Observer.js"></script>
  <script src="./myVue.js"></script>
  <script>
    let vm = new myVue({
      el: "#app",
      data: {
        person: {
          name: "Horace",
          age: 18,
          fav: "programming"
        },
        msg: "Learn MVVM",
        htmlStr: "<h1>Horace</h1>"
      },
      methods: {
        handleClick() {
          console.log(this, '------click');
          // this.$data.person.name = '学习MVVM';
          this.person.name = '学习MVVM';
        }
      }
    })
  </script>
</body>
</html>